﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebMobie.Models;
using WebMobie.Models.Entities;
using WebMobie.Modules.Query;

namespace WebMobie.Controllers
{
	public class HomeController : Controller
	{
		public ActionResult Index()
		{
			ViewBag.action = Defines.ACTION_GET_MOBILES;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_PHONE;
			ViewBag.isHome = true;
            
			return View();
		}

		[Authorize(Roles = "Sale")]
		public ActionResult AdddProduct()
		{
			ViewBag.id = 0;
			ViewBag.category = Defines.CATEGORY_ADD_PRODUCT;
			return View();
		}

		[Authorize(Roles = "Sale")]
		public ActionResult EditProduct(int id)
		{
			ViewBag.id = id;
			return View();
		}

		public ActionResult About()
		{
			ViewBag.Message = "Your app description page.";

			return View();
		}

		public ActionResult Contact()
		{
			ViewBag.Message = "Your contact page.";

			return View();
		}


		public ActionResult ViewProduct(string id)
		{
			ViewBag.id = id;

			return View();
		}

		public ActionResult ViewCart()
		{
			return View();
		}

		public ActionResult ChinhSachBaoHanh()
		{
			return View();
		}

		public ActionResult CachMuaHangOnline()
		{
			return View();
		}

		public ActionResult ViewMobiles()
		{
			ViewBag.action = Defines.ACTION_GET_MOBILES;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_PHONE;
			ViewBag.isHome = true;
			return View();
		}


		public ActionResult ViewMobilesBrand(string id)
		{
			ViewBag.action = Defines.ACTION_GET_MOBILES_BRAND;
			ViewBag.brand = id;
			ViewBag.category = Defines.CATEGORY_PHONE;
			return View();
		}

		public ActionResult ViewPhuKiens()
		{
			ViewBag.action = Defines.ACTION_GET_PHUKIENS;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_PHUKIEN;
			ViewBag.isHome = true;
			return View();
		}

		public ActionResult ViewPhuKiensBrand(string id)
		{

			ViewBag.action = Defines.ACTION_GET_PHUKIENS_BRAND;
			ViewBag.brand = id;
			ViewBag.category = Defines.CATEGORY_PHUKIEN;
			return View();
		}

		public ActionResult ViewMobilesUsed()
		{
			ViewBag.action = Defines.ACTION_GET_USED;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_USED;

			return View();
		}

		public ActionResult ViewTablets()
		{
			ViewBag.action = Defines.ACTION_GET_TABLES;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_TABLET;
			ViewBag.isHome = true;
			return View();
		}

		public ActionResult ViewTabletsBrand(string id)
		{

			ViewBag.action = Defines.ACTION_GET_TABLES_BRAND;
			ViewBag.brand = id;
			ViewBag.category = Defines.CATEGORY_TABLET;
			return View();
		}

		public ActionResult ViewPromotion()
		{
			ViewBag.action = Defines.ACTION_GET_PROMOTION;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_TABLET;
			return View();
		}

		public ActionResult ViewArrive()
		{
			ViewBag.action = Defines.ACTION_GET_ARRIVE;
			ViewBag.brand = Defines.DEFAULT_BRAND;
			ViewBag.category = Defines.CATEGORY_TABLET;
			return View();
		}

		public ActionResult ViewLienHe()
		{
			ViewBag.category = Defines.CATEGORY_CONTACT;
			return View();
		}

		public ActionResult ViewSearch(string id)
		{
			ViewBag.action = Defines.ACTION_GET_SEARCH;
			ViewBag.brand = id;
			ViewBag.category = Defines.CATEGORY_NONE;
			return View();
		}

	}
}
